*****------------------------------------------------******
***** Paper: Revisiting the Impact of Modernization on Support for Women Politicians: The Role of Women’s Political Empowerment  ----****
***** Appendix: All Tables, figures and numbers  
**** Created by: Anja Neundorf, University of Glasgow
**** Date created: 24/02/2020
**** Last updated: 16/11/2020


***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
*Set-up do-file

clear all
set more off
set scheme plottig 
cd "/Users/aneundorf/Dropbox/Project_Regimes/Analysis/Gender/"



 
***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
* APPENDIX 1: Country coverage 

use "Data/MergedData_Gender.dta", clear


table country, c(N women_lead mean women_lead mean coh5_modern_new  mean modern_new_1   )


table country, c(N women_lead  mean coh5_v2x_gender mean v2x_gender  )

***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
* APPENDIX 5: Correlation between measures of modernization

use "Data/MacroData_Gender_long.dta", clear
pwcorr e_Vanhanen_literate_ipo e_miurbani e_peinfmor e_pelifeex e_miferrat e_Vanhanen_nonag_ipo v2peprisch v2pesecsch v2petersch 

***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
* APPENDIX 6: Coefficient of interactions

use "Data/MergedData_Gender.dta", clear


set more off
	*M3.A: Interaction: Modernization + Women pol. empowerment
	reg   women_lead  age c.coh5_modern_new##c.coh5_v2x_gender i.female i.educ_combi i.working i.religion modern_new_1 v2x_gender_1  i.country i.data i.year if age>=20
	estat ic
	estimates store M3A

	*M3.B: Interaction: Modernization + Women pol. empowerment
	reg   women_lead  age c.coh5_modern_new coh5_v2x_gender c.modern_new_1##c.v2x_gender_1 i.female i.educ_combi i.working i.religion  i.country i.data i.year if age>=20
	estat ic
estimates store M3B

	*M4: Interaction: GDP + Women pol. empowerment
	reg   women_lead  age  coh5_e_migdppcln coh5_v2x_gender c.e_migdppcln_1##c.v2x_gender_1 i.female i.educ_combi i.working i.religion  i.country i.data i.year if age>=20
	estat ic
estimates store M4

sum e_migdppcln_1 v2x_gender_1, d

estimates restore M4

	margins, dydx(e_migdppcln_1) at(v2x_gender_1=(0.3(0.1)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel( , angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of logged GPD per Capita""on support for female pol. leaders", size(medium)) ///
	xtitle("Women pol. empowerment (0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("A. Marginal effect of GDP per Capita", size(large))  name(marg_modern2, replace)

estimates restore M4

margins, dydx(v2x_gender_1) at(e_migdppcln_1 =(6.5(0.5)11) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel( , angle(horizontal)labsize(medsmall))  ///
	ytitle("Marginal effect of women pol. empowerment""on support for female pol. leaders", size(medium)) ///
	xtitle("Logged GDP per Capita", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("B. Marginal effect of women pol. empower.", size(large))  name(marg_power2, replace)

graph combine marg_modern2 marg_power2, graphregion(fcolor(white)) title("Context: Current", size(medlarge)) name(current, replace)
graph save "Graphs/Margins_Gender_empower_gdp.gph",  replace
graph export "Graphs/Margins_Gender_empower_gdp.pdf",  replace	



*M5: Interaction: Modernization + % Female legislators


sum coh5_v2lgfemleg v2lgfemleg
gen coh5_v2lgfemleg1 = coh5_v2lgfemleg/100
gen v2lgfemleg1 = v2lgfemleg/100
sum coh5_v2lgfemleg1 v2lgfemleg1


reg   women_lead  age c.coh5_modern_new coh5_v2lgfemleg1  c.modern_new_1##c.v2lgfemleg1 i.female i.educ_combi i.working i.religion  i.country i.data i.year if age>=20
	estat ic
estimates store M5

	margins, dydx(modern_new_1) at(v2lgfemleg1=(0(0.1)0.6) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel( , angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of modernization""on support for female pol. leaders", size(medium)) ///
	xtitle("% Female legislators", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("A. Marginal effect of modernization", size(large))  name(marg_modern2, replace)

estimates restore M5

margins, dydx(v2lgfemleg1) at(modern_new_1 =(0.3(0.1)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel( , angle(horizontal)labsize(medsmall))  ///
	ytitle("Marginal effect of women pol. empowerment""on support for female pol. leaders", size(medium)) ///
	xtitle("Modernization(0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("B. Marginal effect of % female legislators", size(large))  name(marg_power2, replace)

graph combine marg_modern2 marg_power2, graphregion(fcolor(white)) title("Context: Current", size(medlarge)) name(current, replace)
graph save "Graphs/Margins_Gender_legis_modern2.gph",  replace
graph export "Graphs/Margins_Gender_legis_modern2.pdf",  replace



set more off
estout * using "Results/results_Gender_Aug2020_OLS_appendix.txt", transform(ln*: exp(@) exp(@)) ///
	nolz notype delimiter(" `=char(9)'") ///
    cells(b(star fmt(3)) se(par(( )) fmt(3))) starlevels(* .1 ** .05 *** .01) ///
    stats(N ll aic r2, fmt(3)) replace 
	
***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
* APPENDIX 7: Varying socialization ages

foreach num of numlist 5 10 15 20 25 30 {
	
use "Data/MacroData_cohort.dta", clear
sort country cohortmatch5_`num'
save "Data/MacroData_cohort.dta", replace


use "Data/MergedData_Gender.dta", clear

drop coh5_modernization coh5_modern_N coh5_v2x_gender coh5_v2lgfemleg coh5_e_migdppcln coh5_e_pelifeex coh5_e_miferrat coh5_e_miurbani coh5_modern_new

sort country cohortmatch5_`num'
merge  country cohortmatch5_`num' using "Data/MacroData_cohort.dta"
drop _merge

set more off
	*M4: Interaction: Modernization + Women pol. empowerment
	reg   women_lead  age c.coh5_modern_new##c.coh5_v2x_gender i.female i.educ_combi i.working i.religion modern_new_1 v2x_gender_1  i.country i.data i.year if age>=(`num'+5)
	estat ic
	estimates store M_`num'
			estimates store M1a_`k'
			outreg2  `k' using "Results/results_Gender_socialization.xls", ///
			bracket bdec(3) sdec(3) append			
}


	reg   women_lead  age c.coh5_modern_new coh5_v2x_gender c.modern_new_1##c.v2x_gender_1 i.female i.educ_combi i.working i.religion  i.country i.data i.year if age>=20
	estat ic
estimates store M4_2


 
***-----------------------------------------------------------*****
***-----------------------------------------------------------*****
* APPENDIX 8 : Gender differences in the effect 

use "Data/MergedData_Gender_estimates.dta",  clear


	*M6.A: Interaction: Modernization + Women pol. empowerment
	reg   women_lead  age c.coh5_modern_new##c.coh5_v2x_gender i.educ_combi i.working i.religion modern_new_1 v2x_gender_1  i.country i.data i.year if age>=20 & female==0
	estat ic
	estimates store M6A_men
				outreg2  `k' using "/Results/results_Gender_bySex.xls", ///
			bracket bdec(3) sdec(3) append	

reg   women_lead  age c.coh5_modern_new##c.coh5_v2x_gender i.educ_combi i.working i.religion modern_new_1 v2x_gender_1  i.country i.data i.year if age>=20 & female==1
	estat ic
	estimates store M6A_women
				outreg2  `k' using "Results/results_Gender_bySex.xls", ///
			bracket bdec(3) sdec(3) append		


			
*M6.B: Interaction: Modernization + Women pol. empowerment
	reg   women_lead  age c.coh5_modern_new coh5_v2x_gender c.modern_new_1##c.v2x_gender_1  i.educ_combi i.working i.religion  i.country i.data i.year if age>=20 & female==0
	estat ic
	estimates store M6B_men
				outreg2  `k' using "Results/results_Gender_bySex.xls", ///
			bracket bdec(3) sdec(3) append	


reg   women_lead  age c.coh5_modern_new coh5_v2x_gender c.modern_new_1##c.v2x_gender_1  i.educ_combi i.working i.religion  i.country i.data i.year if age>=20 & female==1
	estat ic
	estimates store M6_women
					outreg2  `k' using "Results/results_Gender_bySex.xls", ///
			bracket bdec(3) sdec(3) append	

			
** Figures
estimates restore M6A_men

margins, dydx(coh5_modern_new) at(coh5_v2x_gender=(0(0.2)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel(-15(5)15 , angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of modernization""on support for female pol. leaders", size(medium)) ///
	xtitle("Women pol. empowerment (0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("A. Men", size(large))  name(marg_modern_men1, replace)

estimates restore M6A_women

margins, dydx(coh5_modern_new) at(coh5_v2x_gender=(0(0.2)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel(-15(5)15 , angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of modernization""on support for female pol. leaders", size(medium)) ///
	xtitle("Women pol. empowerment (0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("B. Women", size(large))  name(marg_modern_women1, replace)

graph combine marg_modern_men1 marg_modern_women1, graphregion(fcolor(white)) title("Context: Formative years", size(medlarge)) name(past, replace)


	estimates restore M6B_men
margins, dydx(modern_new_1) at(v2x_gender_1=(0.3(0.1)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel(-40(20)40 , angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of modernization""on support for female pol. leaders", size(medium)) ///
	xtitle("Women pol. empowerment (0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("C. Men", size(large))  name(marg_modern_men, replace)


estimates restore M6_women
	margins, dydx(modern_new_1) at(v2x_gender_1=(0.3(0.1)1) ) atmeans
marginsplot, yline(0) ///
	xlabel( , angle(horizontal)labsize(medsmall)) ylabel(-40(20)40, angle(horizontal)labsize(medsmall)) title(" ")  ///
	ytitle("Marginal effect of modernization""on support for female pol. leaders", size(medium)) ///
	xtitle("Women pol. empowerment (0=none; 1=full)", size(medium))  ///
scheme(plottig) graphregion(fcolor(white)) title("D. Women", size(large))  name(marg_modern_women, replace)

graph combine marg_modern_men marg_modern_women, graphregion(fcolor(white)) title("Context: Current", size(medlarge)) name(current, replace)


graph combine past current, graphregion(fcolor(white)) col(1) altshrink xsize(8) ysize(9)
graph save "Graphs/Margins_Gender_empower_modern_bysex.gph",  replace
graph export "Graphs/Margins_Gender_empower_modern_bysex.pdf",  replace	


	
